<?php session_start();
include_once 'clsAdminController.php';
include 'conn/conn.php';
$arrUserData = array();
$objMyClass = new clsAdminController();


$sql = "SELECT content FROM tbl_youtube_homepage_data";
$run = mysql_query($sql);
while($data = mysql_fetch_array($run))
{
	$content = stripslashes($data['content']);
	$content = str_replace(" ","",$content);
}
?>
<?php
$path = "http://".$_SERVER["HTTP_HOST"]."/gibbons";
?>
<?php
include 'includes/header.php';
?>
<style type="text/css" media="all">@import "layout.css";</style>
<script type="text/javascript" src="../js/jscripts.js"></script>
<script type="text/javascript" src="../jqueryui/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../jqueryui/js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="../jqueryui/js/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="../js/popup.js"></script>
<script type="text/javascript" src="../js/sorttable/sorttable.js"></script>

<table cellpadding="0" cellspacing="0" width="100%" border="0" >
<tr>
<td colspan="2">
<?php
$str = "<a href='home.php?logout' style='text-align:right;'><b>Logout<b></a>";
echo "<div align='right'>Welcome ".$_SESSION['name'].", ".$str."</div>";
?>
</td>
</tr>
<tr>
<td width="15%" valign="top">
<?php
include 'includes/menu.php';
?>
</td>
<td valign="top">
<div id="tabs">
<form>
	<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-left: 30px;">
			<h2><font color="#66FF00"><center>Edit Youtube Homepage Box</center></font></h2>
			<tr>
				<td>
					<!-- TEMPORARY MESSAGE BOX -->
			
			
			<div style="height: 25px;">&nbsp;</div>
			<!-- TEMPORARY MESSAGE BOX ENDS-->
				</td>
			</tr>
			<tr>
				<td>
					<div class="clean-gray">
					<br><center>
					Enter Youtube Embed Link: <input type="text" size="70" name="txtYoutubeVideo" id="txtYoutubeVideo" value="" /><br />
					<br /><label><i>Please enter new youtube video embeded url here.<br />Example:<u>http://www.youtube.com/embed/oq3C8OlZMpY</u></i></label>
					<br />
					</center><br />
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div style="height: 15px;">&nbsp;</div>
					<center><div>
						<input class="btnClass" type="button" name="btnSaveData" id="btnSaveData" value="Submit" onclick="saveYoutubeVideoData();"  />
						<input class="btnClass" type="reset" id="btnResetData" value="Reset"  />
						
					</div></center>
				</td>
			</tr>
			<tr>
				<td>&nbsp;<br /></td>
			</tr>
			<tr align="center">
			<style type="text/css">
			.clean-gray
			{
				border:solid 1px #77776E;
				background:#FFFFCC;
				color:#222222;
				padding:4px;
				text-align:center;
				font-family: Verdana,Arial;
				font-size: 11px;
				font-weight: normal;
				padding: 5px 5px 5px 5px;
				text-align: left; 
				width:800px;
			}
		.btnClass {
		position:relative;
		top:0 px;
		background-color: transparent;
		background-image: url(../images/buttonBackground.gif);
		background-repeat: no-repeat;
		width: 134px;
		height: 30px;
		margin: -2px auto;
		padding: -2px 0 0 0;
		text-align: center;
		font-family: Helvetica, Calibri, Arial, sans-serif;
		font-size: 100%;
		font-weight: bold;
		text-decoration: none;
		border:0px;
		cursor:pointer;
		}
			</style>
				<td align="center">
					<iframe width="311" height="290" src="<?php echo $content; ?>?wmode=transparent" frameborder="1" allowfullscreen></iframe>
				</td>
			</tr>
	</table>
		<link media="screen" rel="stylesheet" href="../css/colorbox.css" />
	<script src="../js/jquery.colorbox.js"></script>
	<script>
		function saveYoutubeVideoData()
		{
			var data =document.getElementById('txtYoutubeVideo').value;
			if(data!="")
			{
				$.post("admin-back-saving.php",{action:"save_youtube_video_data",content:data},function(data){
					alert("Youtube video has been modified.");
					window.location.reload();
				},"text");
			}
			else
			{
				alert("Please enter data in Youtube Video Text box.");
				return false;
			}
		}	
	</script>	
		
</form>




</div>
</td>
</tr>
</table>
<?php
include 'includes/footer.php';
?>

